---
title: "Relationship between height and weight"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Introduction
This is the R code and output used in the study to establish the relationship between height and weight.
```{r}
ANZDATA <- read.csv("C:/Users/HP/Desktop/ANZDATA.csv")
#Summary statistics
summary(ANZDATA$height)
summary(ANZDATA$weight)
##Histograms for the variables
hist(ANZDATA$height, main="Distribution of Height in the Data", col="red")
hist(ANZDATA$weight, main="Distribution of Weight in the Data", col="green")
#Scatterplot
plot(ANZDATA$height,ANZDATA$weight,main="Relationship between Height and Weight",xlab="Height",ylab="Weight")
```
```{r}
#Linear model
plot(ANZDATA$height,ANZDATA$weight,main="Relationship between Height and Weight",xlab="Height",ylab="Weight")
abline(lm(ANZDATA$weight~ANZDATA$height),col="red")
#Correlation Analysis
cor.test(ANZDATA$height,ANZDATA$weight,method="pearson")
```
